package com.txw.javaCore.model.entity;

import lombok.Data;
import lombok.ToString;
import org.springframework.context.ApplicationEvent;

import java.io.Serializable;

/**
 * @PROJECT_NAME: JavaCoreB2
 * @DESCRIPTION: Spring的事件驱动模型：
 *               ApplicationPublisher(生产者)---绑定--->ApplicationEvent(消息)------>ApplicationListener(消费者)
 * @Author: 涂玄武
 * @DATE: 2021/1/19 9:53
 */
@Data
@ToString
public class LoginEvent extends ApplicationEvent implements Serializable {

    private String userName;    //用户名
    private String loginTime;   //登录时间
    private String ip;  //所在IP

    public LoginEvent(Object source) {
        super(source);
    }

    public LoginEvent(Object source,String userName,String loginTime,String ip){
        super(source);
        this.userName = userName;
        this.loginTime = loginTime;
        this.ip = ip;
    }
}
